package com.yeung.exam;

import java.util.Scanner;
import java.util.TreeSet;

public class 被砍掉的树 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int ind = 0;
        int[] removed = new int[n];
        while (ind < n) removed[ind++] = sc.nextInt();

        //开始计算
        TreeSet<Integer> osset = new TreeSet<>();
        for (int i : removed) {
            osset.add(i);
        }


        int[] left = new int[50];
        int[] right = new int[50];
        int lid = 0;
        int rid = 0;
        for (int i = 1; i <= 100; i++) {
            if (i % 2 == 0) left[lid++] = i;
            else right[rid++] = i;
        }
        for (int i = 0; i < left.length; i++) {
            left[i] = getSeq(left, i, osset);
        }
        for (int j = 0; j < right.length; j++) {
            right[j] = getSeq(right, j, osset);
        }
        int lmin = getMax(left);
        int rmin = getMax(right);
        if (left[lmin] > right[rmin])
            System.out.println(lmin + " " + left[lmin]);
        else
            System.out.println(rmin + " " + right[rmin]);


    }

    public static int getSeq(int[] arr, int start, TreeSet<Integer> set) {
        int count = 0;
        for (int x = start; x < arr.length; x++) {
            if (set.contains(arr[x])) break;
            count++;
        }
        return count;
    }

    public static int getMax(int[] arr) {
        int min = Integer.MIN_VALUE;
        int mind = 0;
        for (int i = 0; i < arr.length; i++) {
            if (arr[i] > min) {
                min = arr[i];
                min = i;
            }
        }
        return mind;
    }
}
